import {requestService} from '/src/utils/request'

/**
 * 查询获取部门树
 * @returns {AxiosPromise}
 */
export function treeSelect() {
    return requestService({
        url: '/xiaozhen-system/sysDept/treeSelect',
        method: 'get'
    })
}

// 查询部门列表
export function listDept(query) {
    return requestService({
        url: '/xiaozhen-system/sysDept/list',
        method: 'get',
        params: query
    })
}


// 新增部门
export function addSysDept(data) {
    return requestService({
        url: '/xiaozhen-system/sysDept/add',
        method: 'post',
        data: data
    })
}

// 修改部门
export function updateSysDept(data) {
    return requestService({
        url: '/xiaozhen-system/sysDept/update',
        method: 'put',
        data: data
    })
}

// 删除部门
export function deleteSysDept(deptId) {
    return requestService({
        url: '/xiaozhen-system/sysDept/' + deptId,
        method: 'delete'
    })
}
